package com.changgou.system.search.listener;


import com.changgou.system.search.config.RabbitMQConfig;
import com.changgou.system.search.service.EsManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/*** 商品添加索引库消息监听类 */
@Component
public class GoodsDelListener {

    @Autowired
    private EsManagerService esManagerService;
    //监听某个队列


    @RabbitListener(queues = RabbitMQConfig.SEARCH_DEL_QUEUE)

    public void receiveMessage(String spuId){
        System.out.println("删除索引监听到消息："+spuId);

        esManagerService.delDataBySpuID(spuId);
    }
}

